import request from '../utils/request'

export function getProductList(params) {
  return request({
    url: '/api/creative-products/page',
    method: 'get',
    params
  })
}

export function getProductById(id) {
  return request({
    url: `/api/creative-products/${id}`,
    method: 'get'
  })
}

export function createProduct(data) {
  return request({
    url: '/api/creative-products',
    method: 'post',
    data
  })
}

export function updateProduct(data) {
  return request({
    url: '/api/creative-products',
    method: 'put',
    data
  })
}

export function deleteProduct(id) {
  return request({
    url: `/api/creative-products/${id}`,
    method: 'delete'
  })
}

export function updateProductStock(id, quantity) {
  return request({
    url: `/api/creative-products/${id}/stock`,
    method: 'put',
    params: { quantity }
  })
} 